
#*--encoding:UTF-8--*

'''
整理数据
'''
from common.helper import Helper
from db.mysql import MysqlClient

class Arrangement( object ):

    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "尊享e生爸妈版"

    # 拉取数据
    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):

            data["name"] = self.name
            data["company"] = "众安保险"
            data["year"] = item["year"]
            data["socialSec"] = item["socialSec"]
            data["plan"] = "基础款" if item["plan"] == "PACK181172564003" else "质重款"
            data["expire"] = "1年"
            data["price"] = item["price"]
            data["generalMedical"] = "200w"
            data["cancerMedical"] = "200w"
            data["extSerious"] = "100w" if item["plan"] == "PACK181172564003" else ""
            Helper.mergeTable(self.name, self.mysql, data)
